<?php
//上传
 public function upload_file()
 {
 	if(empty($_FILES)){
 		$this->error('请选择上传文件！');
 	}else{
 		$upload = new \Think\Upload();
 		$upload->maxSize = 3145728;
 		$upload->exts = array('jpg','gif','png','jpeg');
 		$upload->rootPath = '__PUBLIC__/uploads';
 		$upload->savePath = '';
 		$info = $upload->upload();
 		if(!$info){
 			$this->error($upload->geterror());
 		}else{
 			return $info;
 		}
 	}
 }